package com.cooper.dao.brand;

import java.util.List;

import com.cooper.entity.BrandBaseEntity;
import net.paoding.rose.jade.annotation.DAO;
import net.paoding.rose.jade.annotation.Insert;
import net.paoding.rose.jade.annotation.SQL;

@DAO
public interface BrandDAO{

	@Insert(tableName="d_brand_base")
	Long addBrandBase(BrandBaseEntity brandBaseDo);
	
	@SQL("select * from  d_brand_base d where deleted='n' "
			+ " #if(null !=:1.brandName && '' != :1.brandName){ and brandName like CONCAT('%',:1.brandName,'%')} "
			+"order by score desc"
	)
	List<BrandBaseEntity> queryBrandList(BrandBaseEntity brandBaseDo)throws Exception;
	
	
	@SQL("select * from  d_brand_base d where id= :1 "	)
	BrandBaseEntity findBrandBaseById(Long id);
	
	@SQL("update d_brand_base set modifier=:1.modifier,gmt_modified=:1.gmtModified,deleted='y' where id=:1.id ")
	int deleteScheduler(BrandBaseEntity brandBaseDo);
	
}
